package club.emergency.wechat.authorization.search;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Create with IntelliJ IDEA
 * Project Name: wechat
 * Package Name: club.emergency.wechat.authorization.search
 * Date: 2019/3/14
 *
 * @author: 快乐的小菌菌
 * Description:
 */
public interface AuthorizationSearch {

    /**
     * 查询角色
     *
     * @param roleName 角色名称
     * @param pageNo   当前页
     * @param pageSize 每页显示的数据数
     * @return 以字符串形式返回
     */
    @PostMapping("/authorization-search-provider/flipListForRole")
    String flipListForRole(@RequestParam(value = "roleName", required = false) String roleName, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize);

    /**
     * 查询角色对应的权限列表
     *
     * @param roleId 角色id
     * @return 以字符串形式返回
     */
    @PostMapping("/authorization-search-provider/flipListAuthorizationByRoleId")
    String flipListAuthorizationByRoleId(@RequestParam("roleId") Long roleId);

    /**
     * 根据code查询权限列表
     * code为空默认模糊查询一级 like 10%
     *
     * @param code     匹配字段
     * @param parentId 父id
     * @return 以字符串形式返回
     */
    @PostMapping("/authorization-search-provider/flipListAuthorizationByCode")
    String flipListAuthorizationByCode(@RequestParam(value = "code", required = false) Long code, @RequestParam(value = "parentId", required = false) Long parentId);

}
